<?php
include_once '../meihe/common.php';
if ($islogin == 1) {
} else exit("<script language='javascript'>window.location.href='./login.php';</script>");
$title = '易航防红系统';
include './head.php';
?>
<link rel="stylesheet" href="//lib.baomitu.com/toastr.js/latest/css/toastr.min.css">
<div class="row">
    <div class="col-xl-4">
        <div class="card d-block pt-2 pb-1 text-center">
            <img class="card-img-top m-auto" style="height: 68px;width: 68px;margin:auto;display: block;border-radius: 0.3em;box-shadow: 0px 0px 30px #ccc" src="//q4.qlogo.cn/headimg_dl?dst_uin=<?php echo $conf['kfqq'] ?>&spec=640" alt="Card image cap">
            <div class="card-body pb-2">
                <p class="card-text text-success"><?php echo qqname($conf['kfqq']) ?> [ 平台管理员站长 ]</p>
            </div>
            <a class="btn btn-outline-danger mb-2" href="hylist.php"><i class="layui-icon layui-icon-list"></i> 会员列表</a>
            <a class="btn btn-outline-warning mb-2" href="set.php?mod=captcha"><i class="layui-icon layui-icon-list"></i> 登录配置</a>
            <a class="btn btn-outline-primary mb-2" href="userlist.php"><i class="layui-icon layui-icon-list"></i> 用户列表</a>
            <a class="btn btn-outline-success mb-2" href="hylist.php?mod=add"><i class="layui-icon layui-icon-auz"></i> 添加会员</a>
            <a class="btn btn-outline-dark mb-2" href="set.php?mod=account"><i class="layui-icon layui-icon-add-circle"></i> 快捷登录</a>
            <a class="btn btn-outline-warning mb-2" href="userlist.php?mod=add"><i class="layui-icon layui-icon-username"></i> 添加用户</a>
            <a class="btn btn-outline-info mb-2" href="set.php?mod=jgpz"><i class="layui-icon layui-icon-cart-simple"></i> 价格配置</a></a>
            <a class="btn btn-outline-success mb-2" href="workorder.php" id='gdtz'><i class="layui-icon layui-icon-survey"></i> 工单管理</a>
            <a class="btn btn-outline-secondary mb-2" href="javascript:xbb()"><i class="layui-icon layui-icon-console"></i> 检查版本</a>
        </div> <!-- end card-->
    </div>
    <div class="col-lg-6">
        <div class="card">
            <div class="card-body">
                <h4 class="header-title mb-4">广告推荐</h4>
                <span class="list-group-item" id="fhgg"><?php // echo $gxbb['gggl'] ?></cite>
            </div>
        </div>
    </div>
    <div class="col-xl-8">
        <div class="row">
            <div class="col-xl-6">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%;">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('累计生成统计', this, {tips: 1});"> <i class="layui-icon layui-icon-list widget-icon" style="background-color: #ff0a24;color: white;"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">生成总数 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe5"></span>条</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('今日生成统计', this, {tips: 1});"> <i class="layui-icon layui-icon-list widget-icon" style="background-color: #ff824d;color: white"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">今日生成</h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe11"></span>条</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                </div>
            </div>
            <div class="col-xl-6">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('累计访问统计', this, {tips: 1});"> <i class="layui-icon layui-icon-log widget-icon" style="background-color: #98ff3b;color: white"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">访问总数 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe6"></span>条</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%;">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('今日访问统计', this, {tips: 1});"> <i class="layui-icon layui-icon-log widget-icon" style="background-color: #8ed9ff;color: white;"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">今日访问 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe10"></span>次</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                </div>
            </div>
            <div class="col-xl-6">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%;">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('今日交易统计', this, {tips: 1});"> <i class="layui-icon layui-icon-rmb widget-icon" style="background-color: #ff6ba8;color: white;"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">今日收入 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe13"></span>元</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%;">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('QQ交易统计', this, {tips: 1});"> <i class="layui-icon layui-icon-login-qq widget-icon" style="background-color: #FF7043;color: white;"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">QQ交易 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe16"></span>元</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                </div>
            </div>
            <div class="col-xl-6">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%;">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('微信交易统计', this, {tips: 1});"> <i class="layui-icon layui-icon-login-wechat widget-icon" style="background-color: #FF9800;color: white;"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">微信交易 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe17"></span>元</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('支付宝交易统计', this, {tips: 1});"> <i class="layui-icon layui-icon-dollar widget-icon" style="background-color: #40C4FF;color: white"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">支付宝 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe18"></span>元</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                </div>
            </div>
            <div class="col-xl-6">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%;">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('累计用户统计', this, {tips: 1});"> <i class="layui-icon layui-icon-user widget-icon" style="background-color: #9655d0;color: white;"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">用户总数</h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe14"></span>人</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('用户今日注册统计', this, {tips: 1});"> <i class="layui-icon layui-icon-user widget-icon" style="background-color: #a1ccff;color: white"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">今日注册</h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe15"></span>个</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                </div>
            </div>
            <div class="col-xl-6">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%;">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('累计会员统计', this, {tips: 1});"> <i class="layui-icon layui-icon-auz widget-icon" style="background-color: #9655d0;color: white;"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">会员总数 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe2"></span>个</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('今日开通会员统计', this, {tips: 1});"> <i class="layui-icon layui-icon-auz widget-icon" style="background-color: #43A047;color: white"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">今日开通<a href="#jrkthy" data-toggle="modal" class="badge badge-danger-lighten">查看</a></h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe12"></span>个</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                </div>
            </div>
            <div class="col-xl-6">
                <div class="row">
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%;">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('已封禁会员统计', this, {tips: 1});"> <i class="layui-icon layui-icon-auz widget-icon" style="background-color: #9655d0;color: white;"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">封禁会员 </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe1"></span>个</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                    <div class="col-lg-6 col-md-6 col-sm-6 col-xl-6" style="width: 50%">
                        <div class="card widget-flat">
                            <div class="card-body">
                                <div class="float-right" style="width: 30px;height: 30px">
                                    <a href="javascript:;" onclick="layer.tips('黑名单名单统计', this, {tips: 1});"> <i class="layui-icon layui-icon-website widget-icon" style="background-color: #43A047;color: white"></i>
                                </div>
                                <h5 class="text-muted font-weight-normal mt-0">黑名单数
                                </h5>
                                <h5 class="mt-2 mb-0" style="font-weight: 300"><span id="meihe4"></span>个</h5></a>
                            </div> <!-- end card-body-->
                        </div> <!-- end card-->
                    </div> <!-- end col-->
                </div>
            </div>
            <div class="col-xl-6">
                <div class="card">
                    <div class="card-header">
                        安全中心
                    </div>
                    <div class="card-body">
                        <?php
                        $sec_msg = xiaoaqzx();
                        foreach ($sec_msg as $row) {
                            echo $row;
                        }
                        if (count($sec_msg) == 0) echo '<li class="list-group-item"><span class="layui-btn layui-btn-sm btn-success">正常</span>&nbsp;暂未发现网站安全问题</li>';
                        ?>
                    </div>
                </div>
            </div>
        </div> <!-- end row -->
    </div>
</div>
<div class="modal fade" align="left" id="jrkthy" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">今日开通会员列表<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel"></h4>
            </div>
            <div class="card-body">
                <table id="kthy"></table>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" align="left" id="jrktmd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">今日开通白名单列表<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel"></h4>
            </div>
            <div class="card-body">
                <table id="ktmd"></table>
            </div>
        </div>
    </div>
</div>
<?php
include_once './bottom.php';
?>
<script src="../assets/layuiadmin/layui/layui.js"></script>
<script src="http://lib.baomitu.com//jquery/3.4.1/jquery.min.js"></script>
<script src="//cdn.staticfile.org/layer/2.3/layer.js"></script>
<script>
    $(document).ready(function() {
        $.ajax({
            type: "GET",
            url: "ajax.php?act=count",
            dataType: 'json',
            async: true,
            success: function(data) {
                if (data.code == 0) {
                    if (data.count > 0) {
                        layer.tips('平台共有<b>' + data.count + '</b>个工单还未处理哦！', '#gdtz', {
                            tips: [1, 'red'],
                            tipsMore: true,
                            time: 8000
                        });
                    }
                }
            }
        });
    });
    $("select[name='jgpz']").change(function() {
        if ($(this).val() == 1) {
            $("#kthyjg").css("display", "inherit");
        } else {
            $("#kthyjg").css("display", "none");
        }
    });
    $("select[name='jgpz']").change(function() {
        if ($(this).val() == 2) {
            $("#kthyjg2").css("display", "inherit");
        } else {
            $("#kthyjg2").css("display", "none");
        }
    });
    $("select[name='jgpz']").change(function() {
        if ($(this).val() == 3) {
            $("#kthyjg3").css("display", "inherit");
        } else {
            $("#kthyjg3").css("display", "none");
        }
    });
    $("select[name='jgpz']").change(function() {
        if ($(this).val() == 4) {
            $("#kthyjg4").css("display", "inherit");
        } else {
            $("#kthyjg4").css("display", "none");
        }
    });
    $("select[name='jgpz']").change(function() {
        if ($(this).val() == 5) {
            $("#kthyjg5").css("display", "inherit");
        } else {
            $("#kthyjg5").css("display", "none");
        }
    });
    $(document).ready(function() {
        $.ajax({
            type: "GET",
            url: "./ajax.php?act=meihe",
            dataType: 'json',
            async: true,
            success: function(data) {
                $('#yxts').html(data.yxts);
                $('#meihe1').html(data.fjyum);
                $('#meihe2').html(data.vipyum);
                $('#meihe3').html(data.hbmd);
                $('#meihe4').html(data.hmd);
                $('#meihe5').html(data.sczs);
                $('#meiheo5').html(data.sczs);
                $('#meihe6').html(data.fwjl);
                $('#meihe7').html(data.duanljk);
                $('#meihe8').html(data.ymzs);
                $('#meihe9').html(data.yqlj);
                $('#meihe10').html(data.fwjr);
                $('#meihe11').html(data.scjr);
                $('#meiheo11').html(data.scjr);
                $('#meihe12').html(data.jrkthy);
                $('#meihe13').html(data.count5);
                $('#meihe14').html(data.count6);
                $('#meihe15').html(data.count7);
                $('#meihe16').html(data.count12);
                $('#meihe17').html(data.count13);
                $('#meihe18').html(data.count14);
                $("#meihegg").html(data.fhgg);
                layer.close(ii);
                $("#sjjz").html(data)
            }
        });
    })
    $(document).ready(function() {
        sjjz();
    })
    <?php if ($gxbb['code'] == 1) { ?>

        function xbb() {
            layer.confirm('<blockquote class="layui-elem-quote"><?php echo $gxbb['msg'] ?></blockquote><hr><?php echo $gxbb['uplog'] ?>', {
                title: '防洪系统提示',
                closeBtn: 0,
                btn: ['立即更新', '暂时不更']
            }, function() {
                gxcx();
            }, function() {
                layer.msg('啊哦,你已取消更新,又错过了新的功能');
            });
        };
        xbb();
    <?php } else { ?>

        function xbb() {
            layer.confirm('<blockquote class="layui-elem-quote"><?php echo $gxbb['msg'] ?></blockquote>', {
                title: '<?php echo $bbyz ?>',
                closeBtn: 0,
                btn: ['更新日志', '关闭']
            }, function() {
                layer.confirm('<?php echo $gxbb['uplog'] ?>', {
                    title: '更新日志',
                    closeBtn: 0,
                    btn: ['好的了解']
                });
            });
        };
    <?php } ?>
    layui.use('table', function() {
        var table = layui.table;
        table.render({
            elem: '#kthy',
            url: './ajax.php?act=kthy',
            text: {
                none: '可怜！今天没有开通记录'
            },
            cols: [
                [{
                    field: '1',
                    title: 'ID',
                    fixed: 'left',
                    sort: true,
                    minWidth: 70,
                    templet: function(d) {
                        return d.id;
                    }
                }, {
                    field: '2',
                    width: 130,
                    title: '开通域名',
                    templet: function(d) {
                        return d.domain;
                    }
                }, {
                    field: '3',
                    title: '开通ＱＱ',
                    minWidth: 180,
                    templet: function(d) {
                        return '<img src="//q4.qlogo.cn/headimg_dl?dst_uin=' + d.qq + '&spec=640" style="width:15%">  ' + d.qq + ''
                    }
                }, {
                    field: '4',
                    width: 130,
                    title: '开通时间',
                    templet: function(d) {
                        return d.ktsj;
                    }
                }, {
                    field: '6',
                    title: '功能操作',
                    minWidth: 110,
                    templet: function(d) {
                        return '<a href="//' + d.domain + '" class="layui-btn layui-btn-danger layui-btn-xs" rel="noreferrer"><i class="layui-icon layui-icon-search"></i>访问</a>'
                    }
                }]
            ],
            page: true
        });

    });
</script>
<script src="//lib.baomitu.com/toastr.js/latest/toastr.min.js"></script>